transferring data with floppy disks

When no network connection is possible between workstations, you may want to use floppy disks to transfer data between computers. To transfer files between NeXT computers and other UNIX workstations, you must use an appropriate floppy disk, data format, and device driver.

choosing a floppy disk
Choose a floppy disk with a formatted density that is common to both platforms. The 2.88 MB floppy disk drive on NeXT computers allows you to use extended-density (ED) 2.88 MB floppy disks. The NeXT floppy disk drive also reads and writes to floppy disks formatted to a lower density, such as 1.44 MB floppy disks. These are called high-density (HD) disks. Since most UNIX workstations cannot yet read and write to ED disks, you may have to use HD disks as the common medium. 

formatting the floppy disk
A floppy disk can be mounted as a UNIX file system only on platforms that have the same type of file system. Because NeXT uses file system type 4.3 and many other UNIX systems use type 4.2, you may not be able to mount a floppy as a file system on both platforms. In that case, you must use a floppy disk that has only been low-level formatted. Such a floppy disk lacks a file system and is called raw. On a NeXT computer, use the disk -F command for low-level formatting. Other UNIX workstations require similar commands, and the results should be the same on any system.

Low-level formatting should not be confused with initializing. Low-level formatting refers to creating the low-level header and sector marks required for the device driver to find data blocks. Initialization normally refers to the creation of a file system on top of the low-level formatting. 

choosing a common data format
To transfer files, you must use a data format that both platforms can read and write to. Some of the UNIX commands that use data formats common to file systems 4.2 and 4.3 are tar, dd, and cpio. The tar command will be used in the example procedure in this article because it's more commonly used than cpio and because it works recursively on directory trees (dd works on only one file at a time).

choosing the correct device driver
The NeXT software releases and other UNIX operating systems have different names for the device drivers used to access floppy disk drives. On most systems, you use a raw device driver to designate that a floppy disk lacks a file system and therefore cannot be mounted. This is similar to the way you copy files to a tape drive.

The NeXT device drivers that you use to read or write to raw floppy disks that are (or are intended to be) compatible with other UNIX systems are /dev/rfd0b for an internal floppy disk drive and /dev/rsd1h for an external floppy disk drive connected to a SCSI port. Note that you may need to use different device numbers, depending on your hardware configuration; fd0 indicates the first internal floppy drive, and sd1 is the lowest number for an external SCSI device. The b and h in the driver names specify the "live" device, which will write to the disk without a label. The drivers /dev/rfd0a and /dev/rsd1a also work with a raw disk, but they write a file system label on the disk. You will get an error message such as "device error" or "no such device" when you try to use floppy disks that contain this label on other UNIX workstations.

On most other UNIX workstations, /dev/rfd0b refers to the swap partition and can't be used for reading or writing data. In these cases, you can use either /dev/rfd0a or /dev/rfd0c. 

To access a device driver, you must have privileges to read and write to it. On NeXT computers, only root has these privileges by default. If you wish to access the devices as a user other than root, you'll need to add read and write privileges.

transferring files from a NeXT computer to a Sun workstation
Below is an example procedure for transferring files to a Sunâ machine. If you want to transfer files from a Sun workstation, remember to use a different device driver on the Sun computer. If you need to format the floppy disk on the Sun machine, use the fdformat command.

Before you transfer your own files, make sure all the files you want to copy will fit on a floppy disk. (Sun machines use 1.44 MB floppy disks.) If all your files won't fit on one floppy disk, copy the files to several disks by using tar (or whatever) repeatedly and specifying subdirectories or files that will fit on one disk each time. The directory copied in this example contains less than 1.44 MB of data.

1. Using the Terminal application on the NeXT computer, open a shell window and become root.

2. If the floppy disk hasn't already been formatted, format it now. Run the following command and then insert the floppy disk into the drive when you are prompted:

	disk -F /dev/rfd0b

3. Change to the directory that contains the files you want to copy to the floppy disk:

	cd /me/memos

4. Copy the files to the floppy disk. Don't leave out the period at the end of the command line:

	tar -cf /dev/rfd0b .

5. Eject the floppy disk from the drive:
	
	disk -e /dev/rfd0b

6. Now go to the Sun workstation and open a UNIX shell. 

7. Insert the floppy disk into the drive and change to the directory to which you want to copy the files:

	cd /tmp

8. Extract the files:

	tar -xf /dev/fd0a

9. Eject the floppy disk:

	eject